<template>
  <div>
    <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px">
      <el-form-item label="预定须知" >
        <div>
          <el-radio-group v-model="form.option" :disabled="type=='look'">
            <el-radio label="2">使用全局设置</el-radio>
            <el-radio label="1">单独编辑</el-radio>
          </el-radio-group>
          <div v-if="form.option==2">这里可以不做设置，在<el-button type="text" @click="goset">线路设置</el-button
          >中填写全局设置</div>
        </div>
        <quilleditor :disabled="type=='look'" v-show="form.option==1" v-model="form.reserveContent" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import quilleditor from 'components/quilleditor';
export default {
  components: {
    quilleditor
  },
  props: ['type'],
  data() {
    return {
      form: {
        option: '2',
        reserveContent: ''
      },
      rules: {
      },
    };
  },
  methods: {
    goset() {
      window.open('/home/lineGlobalSetting')
    },
    setData(value) {
      let obj= value.reserveInfo
      this.form.option = obj.option
      if(this.form.option == '1') {
        this.form.reserveContent = obj.reserveContent
      }
    },
    async getData() {
      // this.$refs.form.validate()
      let data = {}
      data.reserveInfo = {}
      data.reserveInfo.option = this.form.option
      if(this.form.option == 1) {
        data.reserveInfo.reserveContent == this.form.reserveContent
      }
      return data
    },
  },
  mounted() {
    
  }
};
</script>

<style lang="scss" scoped></style>
